package fr.esiag.isidis.epp.service;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import fr.esiag.isidis.epp.model.SiteModel;
import fr.esiag.isidis.epp.repository.SiteRepository;

@Service
public class SiteService {

	private static Logger logger = Logger.getLogger(CDCAndWeightService.class);

	@Autowired
	private SiteRepository siteRepository;
	
	public void loadCsvFile() throws Exception
	{
		List<SiteModel> items = siteRepository.site_extractFromCsvFile();

		for(SiteModel item : items)
		{
			siteRepository.loadSite(item);
			logger.debug("Insertion de l'item site " + item);
		}
	}
	
}
